We propose a time-sensitive cohort study of patients receiving opioid therapy for chronic non-cancer pain (CNCP) in the setting of shifting opioid prescribing policies. The United States, after decades of aggressive prescribing of opioids for CNCP, is now undergoing changes in prescribing policy and practice that is expected to reduce access to opioids for many patients. The primary care clinics of the San Francisco Health Network (SFHN), a network of integrated clinics managed by San Francisco's Department of Public Health (SFDPH), and local payers are also initiating tight restrictions on opioid prescribing in 2015. These changes include dose limits, restrictions on prescribing to persons with substance use disorders (SUDs), and required urine testing, and checks of the prescription drug monitoring program (PDMP). Many of these changes are designed to reduce diversion and are expected to lead to termination of opioid therapy for many patients. The impact of these changes on those already reliant upon opioids is unknown, although anecdotal evidence suggests that some patients initiate or resume illicit opioid use as prescribed opioids are terminated. In addition, there is little understanding of the rate, risk factors and event-level characteristics of opioid overdose among patients receiving opioids for pain. To address these major gaps in public health research, we will establish the Cohort study of Opioids, Pain and safety IN an era of chanGing policy (COPING), which will document changes in pain, functional status, prescribed opioid use and illicit substance use in the setting of shifting availability of prescribed opioids and identify opioid overdose patterns and risks in a population prescribed prescription opioids. We will recruit 400 patients prescribed ?30 morphine equivalent milligrams of opioids daily for chronic, non-cancer pain, including at least 100 actively using illicit opioid, cocaine or methamphetamine and at least 100 living with HIV, from the SFHN registry of patients on chronic opioids for pain (Pain Management Registry, or PMR, N=2,879), including patients whose opioids were recently discontinued. COPING participants will be seen every 6 months for phlebotomy; behavioral assessments on opioids, alcohol and drug use, pain control, and overdose events (Aim 1), and HIV treatment outcomes (Aim 4); and clinical evaluations for functional status (Aim 2). Biannual reviews of medical charts and administrative data will be conducted to evaluate incidence of major medical events (Aim 3). We will use generalized estimating equation (GEE) linear, logistic, and multinomial models to estimate and compare trends in behavioral and clinical outcomes and functional status, to prescribed opioids (continued versus reduced/lost access), and overall. We will assess incidence rates of opioid overdose using person-time methods and marginal structural models with stabilized inverse probability of treatment weights to estimate exposure effects for cases with time-dependent confounders that are affected by previous exposures as well as exposures that are affected by previous overdose events.